#include<stdio.h>
#include<stdlib.h>

int main(void)
{
	char chess[9];
	for(int i=0;i<3;i++)
	{
		for(int j=0;j<3;j++)
		{
			scanf("%c",&chess[i*3+j]);
		}
		getchar();
	}
	if((chess[0]=='O'&&chess[1]=='O'&&chess[2]=='O')||\
(chess[3]=='O'&&chess[4]=='O'&&chess[5]=='O')||\
(chess[6]=='O'&&chess[7]=='O'&&chess[8]=='O')||\
(chess[0]=='O'&&chess[3]=='O'&&chess[6]=='O')||\
(chess[1]=='O'&&chess[4]=='O'&&chess[7]=='O')||\
(chess[2]=='O'&&chess[5]=='O'&&chess[8]=='O')||\
(chess[0]=='O'&&chess[4]=='O'&&chess[8]=='O')||\
(chess[2]=='O'&&chess[4]=='O'&&chess[6]=='O'))
{
	printf("CXKNB");
}
else
{
	printf("AWNB");
}
	
	return 0;
}
